package com.hdu.kdk_feign.paramHandler;

import com.hdu.kdk_feign.utils.ExtensionServiceLoader;

import java.util.List;

public class ParamHandlerComposite {

    private static final List<ParamHandler> PARAM_HANDLERS = ExtensionServiceLoader.get(ParamHandler.class);

    public static void handle(TotalRequestParamInfo totalRequestParamInfo, List<Param> paramList) {
        paramList.forEach(param ->
                PARAM_HANDLERS.forEach(h -> {
                    if (h.support(param)) {
                        h.handle(totalRequestParamInfo, param);
                    }
                })
        );
    }

}
